import type { MockConfig, MockMethod } from "vite-plugin-mock";

import Mock from "mockjs";

import baseResponse from "./base";

export default (config?: MockConfig) => {
  return [
    {
      url: "/api/getHotKeys",
      method: "get",
      response: ({ body }: { body: any }) => {
        const data = {
          hotKeys: [
            {
              key: "我们的歌 ",
              id: 765562,
            },
            {
              key: "冰雪奇缘2 ",
              id: 587404,
            },
            {
              key: "张杰 ",
              id: 323823,
            },
            {
              key: "桥边姑娘 ",
              id: 287637,
            },
            {
              key: "星辰大海 ",
              id: 202868,
            },
            {
              key: "哪咤 李宇春 ",
              id: 192652,
            },
            {
              key: "左手指月 ",
              id: 164609,
            },
            {
              key: "邓紫棋 ",
              id: 155475,
            },
            {
              key: "酒醉的蝴蝶 ",
              id: 154236,
            },
            {
              key: "左肩 ",
              id: 139814,
            },
          ],
        };
        return baseResponse.success(data);
      },
    },
  ] as MockMethod[];
};
